
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>6.1 堆内核堆外内存规划 · 大数据 bigdata_spark_kernel-optimize_atguigu 课堂笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content=" 李振超">
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-page-toc-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-prism/prism-solarizedlight.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-change_girls/girls.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="styles/website.css">
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="62-nei-cun-kong-jian-fen-pei.html" />
    
    
    <link rel="prev" href="di-6-zhang-spark-nei-cun-jie-xi.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://www.atguigu.com/" target="_blank" class="custom-link">联系我们</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        <li class="header">第 1 部分: Spark 内核</li>
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    第 1 章 Spark 内核概述
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="11-spark-he-xin-zu-jian-hui-gu.html">
            
                <a href="11-spark-he-xin-zu-jian-hui-gu.html">
            
                    
                    1.1 Spark 核心组件回顾
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2" data-path="12-spark-tong-yong-yun-xing-liu-cheng-gai-shu.html">
            
                <a href="12-spark-tong-yong-yun-xing-liu-cheng-gai-shu.html">
            
                    
                    1.2 Spark 通用运行流程概述
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="chapter1.html">
            
                <a href="chapter1.html">
            
                    
                    第 2 章 Spark 通讯架构
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="chapter1/21-spark-tong-xun-jia-gou-gai-shu.html">
            
                <a href="chapter1/21-spark-tong-xun-jia-gou-gai-shu.html">
            
                    
                    2.1 Spark 通讯架构概述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="chapter1/23-spark-tong-xin-jia-gou-jie-xi.html">
            
                <a href="chapter1/23-spark-tong-xin-jia-gou-jie-xi.html">
            
                    
                    2.2 Spark 通信架构解析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="chapter1/22-spark-qi-dong-liu-cheng-fen-xi.html">
            
                <a href="chapter1/22-spark-qi-dong-liu-cheng-fen-xi.html">
            
                    
                    2.3 Spark 启动流程分析
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.3.1" data-path="chapter1/22-spark-qi-dong-liu-cheng-fen-xi/231-master-liu-cheng-fen-xi.html">
            
                <a href="chapter1/22-spark-qi-dong-liu-cheng-fen-xi/231-master-liu-cheng-fen-xi.html">
            
                    
                    2.3.1 Master 启动源码分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.2" data-path="chapter1/22-spark-qi-dong-liu-cheng-fen-xi/232-worker-liu-cheng-fen-xi.html">
            
                <a href="chapter1/22-spark-qi-dong-liu-cheng-fen-xi/232-worker-liu-cheng-fen-xi.html">
            
                    
                    2.3.2 Worker 启动源码分析
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="di-3-zhang-spark-bu-shu-mo-shi.html">
            
                <a href="di-3-zhang-spark-bu-shu-mo-shi.html">
            
                    
                    第 3 章 Spark 部署模式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="di-3-zhang-spark-bu-shu-mo-shi/31-yarn-mo-shi-yun-xing-ji-zhi.html">
            
                <a href="di-3-zhang-spark-bu-shu-mo-shi/31-yarn-mo-shi-yun-xing-ji-zhi.html">
            
                    
                    3.1 Yarn 模式运行机制
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1.1" data-path="di-3-zhang-spark-bu-shu-mo-shi/31-yarn-mo-shi-yun-xing-ji-zhi/yarn-mo-shi-yun-xing-ji-zhi-yuan-ma-fen-xi.html">
            
                <a href="di-3-zhang-spark-bu-shu-mo-shi/31-yarn-mo-shi-yun-xing-ji-zhi/yarn-mo-shi-yun-xing-ji-zhi-yuan-ma-fen-xi.html">
            
                    
                    1. Yarn cluster 模式运行机制源码分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.2" data-path="di-3-zhang-spark-bu-shu-mo-shi/31-yarn-mo-shi-yun-xing-ji-zhi/yarn-client-mo-shi-yun-xing-ji-zhi-yuan-ma-fen-xi.html">
            
                <a href="di-3-zhang-spark-bu-shu-mo-shi/31-yarn-mo-shi-yun-xing-ji-zhi/yarn-client-mo-shi-yun-xing-ji-zhi-yuan-ma-fen-xi.html">
            
                    
                    2. Yarn client 模式运行机制源码分析
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="di-3-zhang-spark-bu-shu-mo-shi/32-standalone-mo-shi-yun-xing-ji-zhi.html">
            
                <a href="di-3-zhang-spark-bu-shu-mo-shi/32-standalone-mo-shi-yun-xing-ji-zhi.html">
            
                    
                    3.2 Standalone 模式运行机制
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="di-4-zhang-spark-ren-wu-diao-du-ji-zhi.html">
            
                <a href="di-4-zhang-spark-ren-wu-diao-du-ji-zhi.html">
            
                    
                    第 4 章 Spark 任务调度机制
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/41-spark-ren-wu-diao-du-gai-shu.html">
            
                <a href="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/41-spark-ren-wu-diao-du-gai-shu.html">
            
                    
                    4.1 Spark 任务调度概述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/42-spark-stage-ji-bie-diao-du.html">
            
                <a href="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/42-spark-stage-ji-bie-diao-du.html">
            
                    
                    4.2 Spark Stage 级别调度
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/43-spark-task-ji-bie-diao-du.html">
            
                <a href="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/43-spark-task-ji-bie-diao-du.html">
            
                    
                    4.3 Spark Task 级别调度
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.3.1" data-path="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/43-spark-task-ji-bie-diao-du/431-diao-du-ce-lve.html">
            
                <a href="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/43-spark-task-ji-bie-diao-du/431-diao-du-ce-lve.html">
            
                    
                    4.3.1 调度策略
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3.2" data-path="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/43-spark-task-ji-bie-diao-du/432-ben-di-hua-diao-du.html">
            
                <a href="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/43-spark-task-ji-bie-diao-du/432-ben-di-hua-diao-du.html">
            
                    
                    4.3.2 本地化调度
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3.3" data-path="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/43-spark-task-ji-bie-diao-du/433-shi-bai-zhong-shi-he-hei-ming-dan.html">
            
                <a href="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/43-spark-task-ji-bie-diao-du/433-shi-bai-zhong-shi-he-hei-ming-dan.html">
            
                    
                    4.3.3 失败重试和黑名单
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/44-ren-wu-diao-du-yuan-ma-fen-xi.html">
            
                <a href="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/44-ren-wu-diao-du-yuan-ma-fen-xi.html">
            
                    
                    4.4 Stage 级别任务调度源码分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/45-task-ji-bie-ren-wu-diao-du-yuan-ma-fen-xi.html">
            
                <a href="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/45-task-ji-bie-ren-wu-diao-du-yuan-ma-fen-xi.html">
            
                    
                    4.5 Task 级别任务调度源码分析
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="di-5-zhang-spark-shuffle-jie-xi.html">
            
                <a href="di-5-zhang-spark-shuffle-jie-xi.html">
            
                    
                    第 5 章 Spark Shuffle 解析
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="di-5-zhang-spark-shuffle-jie-xi/51-shuffle-de-he-xin-yao-dian.html">
            
                <a href="di-5-zhang-spark-shuffle-jie-xi/51-shuffle-de-he-xin-yao-dian.html">
            
                    
                    5.1 Shuffle 的核心要点
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="di-5-zhang-spark-shuffle-jie-xi/52-hashshuffle-jie-xi.html">
            
                <a href="di-5-zhang-spark-shuffle-jie-xi/52-hashshuffle-jie-xi.html">
            
                    
                    5.2 HashShuffle 解析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="di-5-zhang-spark-shuffle-jie-xi/53-sortshuffle-jie-xi.html">
            
                <a href="di-5-zhang-spark-shuffle-jie-xi/53-sortshuffle-jie-xi.html">
            
                    
                    5.3 SortShuffle 解析
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.3.1" data-path="di-5-zhang-spark-shuffle-jie-xi/53-sortshuffle-jie-xi/sortshuffle-yuan-ma-jie-xi.html">
            
                <a href="di-5-zhang-spark-shuffle-jie-xi/53-sortshuffle-jie-xi/sortshuffle-yuan-ma-jie-xi.html">
            
                    
                    SortShuffle 源码解析
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="di-6-zhang-spark-nei-cun-jie-xi.html">
            
                <a href="di-6-zhang-spark-nei-cun-jie-xi.html">
            
                    
                    第 6 章 Spark 内存管理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.6.1" data-path="61-dui-nei-he-dui-wai-nei-cun-gui-hua.html">
            
                <a href="61-dui-nei-he-dui-wai-nei-cun-gui-hua.html">
            
                    
                    6.1 堆内核堆外内存规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="62-nei-cun-kong-jian-fen-pei.html">
            
                <a href="62-nei-cun-kong-jian-fen-pei.html">
            
                    
                    6.2 内存空间分配
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="63-cun-chu-nei-cun-guan-li.html">
            
                <a href="63-cun-chu-nei-cun-guan-li.html">
            
                    
                    6.3 存储内存管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="64-zhi-xing-nei-cun-guan-li.html">
            
                <a href="64-zhi-xing-nei-cun-guan-li.html">
            
                    
                    6.4 执行内存管理
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">第 2 部分: Spark 性能优化和故障处理</li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-7-zhang-spark-xing-neng-you-hua.html">
            
                <a href="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-7-zhang-spark-xing-neng-you-hua.html">
            
                    
                    第 7 章 Spark 性能优化
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1" data-path="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-7-zhang-spark-xing-neng-you-hua/71-chang-gui-xing-neng-diao-you.html">
            
                <a href="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-7-zhang-spark-xing-neng-you-hua/71-chang-gui-xing-neng-diao-you.html">
            
                    
                    7.1 常规性能调优
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2" data-path="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-7-zhang-spark-xing-neng-you-hua/72-suan-zi-diao-you.html">
            
                <a href="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-7-zhang-spark-xing-neng-you-hua/72-suan-zi-diao-you.html">
            
                    
                    7.2 算子调优
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3" data-path="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-7-zhang-spark-xing-neng-you-hua/73-shuffle-diao-you.html">
            
                <a href="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-7-zhang-spark-xing-neng-you-hua/73-shuffle-diao-you.html">
            
                    
                    7.3 Shuffle 调优
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4" data-path="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-7-zhang-spark-xing-neng-you-hua/74-jvm-diao-you.html">
            
                <a href="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-7-zhang-spark-xing-neng-you-hua/74-jvm-diao-you.html">
            
                    
                    7.4 JVM 调优
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-8-zhang-spark-shu-ju-qing-xie.html">
            
                <a href="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-8-zhang-spark-shu-ju-qing-xie.html">
            
                    
                    第 8 章 Spark 数据倾斜解决方案
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-9-zhang-spark-troubleshooting.html">
            
                <a href="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-9-zhang-spark-troubleshooting.html">
            
                    
                    第 9 章 Spark Troubleshooting
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >6.1 堆内核堆外内存规划</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="61-&#x5806;&#x5185;&#x6838;&#x5806;&#x5916;&#x5185;&#x5B58;&#x89C4;&#x5212;">6.1 &#x5806;&#x5185;&#x6838;&#x5806;&#x5916;&#x5185;&#x5B58;&#x89C4;&#x5212;</h1>
<p>Spark &#x5C06;&#x5185;&#x5B58;&#x4ECE;&#x903B;&#x8F91;&#x4E0A;&#x533A;&#x5206;&#x4E3A;<my>&#x5806;&#x5185;&#x5185;&#x5B58;</my>&#x548C;<my>&#x5806;&#x5916;&#x5185;&#x5B58;</my>, &#x79F0;&#x4E3A;&#x5185;&#x5B58;&#x6A21;&#x578B;(<code>MemoryMode</code>).  </p>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1554772793.png-atguiguText" alt=""></p>
<p>&#x679A;&#x4E3E;&#x7C7B;&#x578B;<code>MemoryMode</code>&#x4E2D;&#x5B9A;&#x4E49;&#x4E86;&#x5806;&#x5185;&#x5B58;&#x548C;&#x5806;&#x5916;&#x5185;&#x5B58;:</p>
<pre class="language-"><code class="lang-java"><span class="token annotation punctuation">@Private</span>
<span class="token keyword">public</span> <span class="token keyword">enum</span> MemoryMode <span class="token punctuation">{</span>
  ON_HEAP<span class="token punctuation">,</span>   <span class="token comment">// &#x5806;&#x5185;&#x5185;&#x5B58;</span>
  OFF_HEAP   <span class="token comment">// &#x5806;&#x5916;&#x5185;&#x5B58;</span>
<span class="token punctuation">}</span>
</code></pre>
<blockquote>
<h4 id="&#x8BF4;&#x660E;"><em>&#x8BF4;&#x660E;:</em></h4>
</blockquote>
<ul>
<li><p>&#x8FD9;&#x91CC;&#x7684;&#x5806;&#x5185;&#x5B58;&#x4E0D;&#x80FD;&#x4E0E; JVM &#x4E2D;&#x7684; Java &#x5806;&#x76F4;&#x63A5;&#x753B;&#x7B49;&#x53F7;, &#x5B83;&#x53EA;&#x662F; JVM &#x5806;&#x5185;&#x5B58;&#x7684;&#x4E00;&#x90E8;&#x5206;. &#x7531; JVM &#x7EDF;&#x4E00;&#x7BA1;&#x7406;</p>
</li>
<li><p>&#x5806;&#x5916;&#x5185;&#x5B58;&#x5219;&#x662F; Spark &#x4F7F;&#x7528; <code>sun.misc.Unsafe</code>&#x7684; API &#x76F4;&#x63A5;&#x5728;&#x5DE5;&#x4F5C;&#x8282;&#x70B9;&#x7684;&#x7CFB;&#x7EDF;&#x5185;&#x5B58;&#x4E2D;&#x5F00;&#x8F9F;&#x7684;&#x7A7A;&#x95F4;.</p>
</li>
</ul>
<h2 id="&#x5185;&#x5B58;&#x6C60;">&#x5185;&#x5B58;&#x6C60;</h2>
<p>&#x65E0;&#x8BBA;&#x524D;&#x9762;&#x7684;&#x54EA;&#x79CD;&#x5185;&#x5B58;, &#x90FD;&#x9700;&#x8981;&#x4E00;&#x4E2A;&#x5185;&#x5B58;&#x6C60;&#x5BF9;&#x5185;&#x5B58;&#x8FDB;&#x884C;&#x8D44;&#x6E90;&#x7BA1;&#x7406;, &#x62BD;&#x8C61;&#x7C7B;<code>MemoryPool</code>&#x5B9A;&#x4E49;&#x4E86;&#x5185;&#x5B58;&#x6C60;&#x7684;&#x89C4;&#x8303;:</p>
<pre class="language-"><code class="lang-scala"><span class="token keyword">private</span><span class="token punctuation">[</span>memory<span class="token punctuation">]</span> <span class="token keyword">abstract</span> <span class="token keyword">class</span> MemoryPool<span class="token punctuation">(</span>lock<span class="token operator">:</span> Object<span class="token punctuation">)</span> <span class="token punctuation">{</span>

    <span class="token annotation punctuation">@GuardedBy</span><span class="token punctuation">(</span><span class="token string">&quot;lock&quot;</span><span class="token punctuation">)</span>
    <span class="token keyword">private</span><span class="token punctuation">[</span><span class="token keyword">this</span><span class="token punctuation">]</span> <span class="token keyword">var</span> _poolSize<span class="token operator">:</span> <span class="token builtin">Long</span> <span class="token operator">=</span> <span class="token number">0</span>

    <span class="token comment">/**
      * Returns the current size of the pool, in bytes.
      */</span>
    <span class="token keyword">final</span> <span class="token keyword">def</span> poolSize<span class="token operator">:</span> <span class="token builtin">Long</span> <span class="token operator">=</span> lock<span class="token punctuation">.</span>synchronized <span class="token punctuation">{</span>
        _poolSize
    <span class="token punctuation">}</span>

    <span class="token comment">/**
      * Returns the amount of free memory in the pool, in bytes.
      */</span>
    <span class="token keyword">final</span> <span class="token keyword">def</span> memoryFree<span class="token operator">:</span> <span class="token builtin">Long</span> <span class="token operator">=</span> lock<span class="token punctuation">.</span>synchronized <span class="token punctuation">{</span>
        _poolSize <span class="token operator">-</span> memoryUsed
    <span class="token punctuation">}</span>

    <span class="token comment">/**
      * Expands the pool by `delta` bytes.
      */</span>
    <span class="token keyword">final</span> <span class="token keyword">def</span> incrementPoolSize<span class="token punctuation">(</span>delta<span class="token operator">:</span> <span class="token builtin">Long</span><span class="token punctuation">)</span><span class="token operator">:</span> <span class="token builtin">Unit</span> <span class="token operator">=</span> lock<span class="token punctuation">.</span>synchronized <span class="token punctuation">{</span>
        require<span class="token punctuation">(</span>delta <span class="token operator">&gt;=</span> <span class="token number">0</span><span class="token punctuation">)</span>
        _poolSize <span class="token operator">+=</span> delta
    <span class="token punctuation">}</span>

    <span class="token comment">/**
      * Shrinks the pool by `delta` bytes.
      */</span>
    <span class="token keyword">final</span> <span class="token keyword">def</span> decrementPoolSize<span class="token punctuation">(</span>delta<span class="token operator">:</span> <span class="token builtin">Long</span><span class="token punctuation">)</span><span class="token operator">:</span> <span class="token builtin">Unit</span> <span class="token operator">=</span> lock<span class="token punctuation">.</span>synchronized <span class="token punctuation">{</span>
        require<span class="token punctuation">(</span>delta <span class="token operator">&gt;=</span> <span class="token number">0</span><span class="token punctuation">)</span>
        require<span class="token punctuation">(</span>delta <span class="token operator">&lt;=</span> _poolSize<span class="token punctuation">)</span>
        require<span class="token punctuation">(</span>_poolSize <span class="token operator">-</span> delta <span class="token operator">&gt;=</span> memoryUsed<span class="token punctuation">)</span>
        _poolSize <span class="token operator">-=</span> delta
    <span class="token punctuation">}</span>

    <span class="token comment">/**
      * Returns the amount of used memory in this pool (in bytes).
      */</span>
    <span class="token keyword">def</span> memoryUsed<span class="token operator">:</span> <span class="token builtin">Long</span>
<span class="token punctuation">}</span>
</code></pre>
<p>&#x6709;&#x4E24;&#x4E2A;&#x5B9E;&#x73B0;&#x7C7B;:</p>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1554772637.png-atguiguText" alt=""></p>
<hr>
<h2 id="&#x5806;&#x5185;&#x5185;&#x5B58;">&#x5806;&#x5185;&#x5185;&#x5B58;</h2>
<p>&#x5806;&#x5185;&#x5185;&#x5B58;&#x7684;&#x5927;&#x5C0F;&#x7531; Spark &#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x542F;&#x52A8;&#x65F6;&#x7684;<code>-executor-memory</code> &#x6216; <code>spark.executor.memory</code> &#x53C2;&#x6570;&#x914D;&#x7F6E;.</p>
<ol>
<li><p><code>Executor</code> &#x5185;&#x8FD0;&#x884C;&#x7684;&#x5E76;&#x53D1;&#x4EFB;&#x52A1;&#x5171;&#x4EAB; JVM &#x5806;&#x5185;&#x5185;&#x5B58;, &#x8FD9;&#x4E9B;&#x4EFB;&#x52A1;&#x5728;&#x7F13;&#x5B58; RDD &#x6570;&#x636E;&#x548C;&#x5E7F;&#x64AD;&#x6570;&#x636E;&#x65F6;&#x5360;&#x7528;&#x7684;&#x5185;&#x5B58;&#x88AB;&#x89C4;&#x5212;&#x4E3A;<my>&#x5B58;&#x50A8;&#x5185;&#x5B58;</my></p>
</li>
<li><p>&#x800C;&#x8FD9;&#x4E9B;&#x4EFB;&#x52A1;&#x5728;&#x6267;&#x884C; Shuffle &#x65F6;&#x5360;&#x7528;&#x7684;&#x5185;&#x5B58;&#x88AB;&#x89C4;&#x5212;&#x4E3A;&#x6267;&#x884C;&#x5185;&#x5B58;.</p>
</li>
<li><p>&#x5269;&#x4F59;&#x7684;&#x90E8;&#x5206;&#x4E0D;&#x505A;&#x7279;&#x6B8A;&#x89C4;&#x5212;, &#x90A3;&#x4E9B; Spark &#x5185;&#x90E8;&#x7684;&#x5BF9;&#x8C61;&#x5B9E;&#x4F8B;, &#x6216;&#x8005;&#x7528;&#x6237;&#x5B9A;&#x4E49;&#x7684; Spark &#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x4E2D;&#x7684;&#x5BF9;&#x8C61;&#x5B9E;&#x4F8B;, &#x5747;&#x5360;&#x7528;&#x5269;&#x4F59;&#x7684;&#x7A7A;&#x95F4;. </p>
</li>
</ol>
<p>&#x4E0D;&#x540C;&#x7684;&#x7BA1;&#x7406;&#x6A21;&#x5F0F;&#x4E0B;, &#x8FD9;&#x4E09;&#x90E8;&#x5206;&#x5360;&#x7528;&#x7684;&#x7A7A;&#x95F4;&#x5927;&#x5C0F;&#x5404;&#x4E0D;&#x76F8;&#x540C;.</p>
<p>Spark &#x5BF9;&#x5806;&#x5185;&#x5185;&#x5B58;&#x7684;&#x7BA1;&#x7406;&#x662F;&#x4E00;&#x79CD;&#x903B;&#x8F91;&#x4E0A;&#x7684;&#x201D;&#x89C4;&#x5212;&#x5F0F;&#x201D;&#x7684;&#x7BA1;&#x7406;&#xFF0C;&#x56E0;&#x4E3A;&#x5BF9;&#x8C61;&#x5B9E;&#x4F8B;&#x5360;&#x7528;&#x5185;&#x5B58;&#x7684;&#x7533;&#x8BF7;&#x548C;&#x91CA;&#x653E;&#x90FD;&#x7531; JVM &#x5B8C;&#x6210;&#xFF0C;Spark &#x53EA;&#x80FD;&#x5728;&#x7533;&#x8BF7;&#x540E;&#x548C;&#x91CA;&#x653E;&#x524D;&#x8BB0;&#x5F55;&#x8FD9;&#x4E9B;&#x5185;&#x5B58;&#xFF0C;&#x6211;&#x4EEC;&#x6765;&#x770B;&#x5176;&#x5177;&#x4F53;&#x6D41;&#x7A0B;&#xFF1A;</p>
<h3 id="&#x7533;&#x8BF7;&#x5185;&#x5B58;&#x6D41;&#x7A0B;&#x5982;&#x4E0B;&#xFF1A;">&#x7533;&#x8BF7;&#x5185;&#x5B58;&#x6D41;&#x7A0B;&#x5982;&#x4E0B;&#xFF1A;</h3>
<ol>
<li>Spark &#x5728;&#x4EE3;&#x7801;&#x4E2D; new &#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#x5B9E;&#x4F8B;&#xFF1B;</li>
<li>JVM &#x4ECE;&#x5806;&#x5185;&#x5185;&#x5B58;&#x5206;&#x914D;&#x7A7A;&#x95F4;&#xFF0C;&#x521B;&#x5EFA;&#x5BF9;&#x8C61;&#x5E76;&#x8FD4;&#x56DE;&#x5BF9;&#x8C61;&#x5F15;&#x7528;&#xFF1B;</li>
<li>Spark &#x4FDD;&#x5B58;&#x8BE5;&#x5BF9;&#x8C61;&#x7684;&#x5F15;&#x7528;&#xFF0C;&#x8BB0;&#x5F55;&#x8BE5;&#x5BF9;&#x8C61;&#x5360;&#x7528;&#x7684;&#x5185;&#x5B58;&#x3002;</li>
</ol>
<h3 id="&#x91CA;&#x653E;&#x5185;&#x5B58;&#x6D41;&#x7A0B;&#x5982;&#x4E0B;">&#x91CA;&#x653E;&#x5185;&#x5B58;&#x6D41;&#x7A0B;&#x5982;&#x4E0B;</h3>
<ol>
<li>Spark&#x8BB0;&#x5F55;&#x8BE5;&#x5BF9;&#x8C61;&#x91CA;&#x653E;&#x7684;&#x5185;&#x5B58;&#xFF0C;&#x5220;&#x9664;&#x8BE5;&#x5BF9;&#x8C61;&#x7684;&#x5F15;&#x7528;&#xFF1B;</li>
<li>&#x7B49;&#x5F85;JVM&#x7684;&#x5783;&#x573E;&#x56DE;&#x6536;&#x673A;&#x5236;&#x91CA;&#x653E;&#x8BE5;&#x5BF9;&#x8C61;&#x5360;&#x7528;&#x7684;&#x5806;&#x5185;&#x5185;&#x5B58;&#x3002;</li>
</ol>
<h3 id="&#x5B58;&#x5728;&#x7684;&#x95EE;&#x9898;">&#x5B58;&#x5728;&#x7684;&#x95EE;&#x9898;</h3>
<ol>
<li><p>&#x6211;&#x4EEC;&#x77E5;&#x9053;&#xFF0C;JVM &#x7684;&#x5BF9;&#x8C61;&#x53EF;&#x4EE5;&#x4EE5;&#x5E8F;&#x5217;&#x5316;&#x7684;&#x65B9;&#x5F0F;&#x5B58;&#x50A8;&#xFF0C;&#x5E8F;&#x5217;&#x5316;&#x7684;&#x8FC7;&#x7A0B;&#x662F;&#x5C06;&#x5BF9;&#x8C61;&#x8F6C;&#x6362;&#x4E3A;&#x4E8C;&#x8FDB;&#x5236;&#x5B57;&#x8282;&#x6D41;&#xFF0C;&#x672C;&#x8D28;&#x4E0A;&#x53EF;&#x4EE5;&#x7406;&#x89E3;&#x4E3A;&#x5C06;&#x975E;&#x8FDE;&#x7EED;&#x7A7A;&#x95F4;&#x7684;&#x94FE;&#x5F0F;&#x5B58;&#x50A8;&#x8F6C;&#x5316;&#x4E3A;&#x8FDE;&#x7EED;&#x7A7A;&#x95F4;&#x6216;&#x5757;&#x5B58;&#x50A8;&#xFF0C;&#x5728;&#x8BBF;&#x95EE;&#x65F6;&#x5219;&#x9700;&#x8981;&#x8FDB;&#x884C;&#x5E8F;&#x5217;&#x5316;&#x7684;&#x9006;&#x8FC7;&#x7A0B;&#x2014;&#x2014;&#x53CD;&#x5E8F;&#x5217;&#x5316;&#xFF0C;&#x5C06;&#x5B57;&#x8282;&#x6D41;&#x8F6C;&#x5316;&#x4E3A;&#x5BF9;&#x8C61;&#xFF0C;<my>&#x5E8F;&#x5217;&#x5316;&#x7684;&#x65B9;&#x5F0F;&#x53EF;&#x4EE5;&#x8282;&#x7701;&#x5B58;&#x50A8;&#x7A7A;&#x95F4;&#xFF0C;&#x4F46;&#x589E;&#x52A0;&#x4E86;&#x5B58;&#x50A8;&#x548C;&#x8BFB;&#x53D6;&#x65F6;&#x5019;&#x7684;&#x8BA1;&#x7B97;&#x5F00;&#x9500;&#x3002;</my></p>
</li>
<li><p>&#x5BF9;&#x4E8E; Spark &#x4E2D;&#x5E8F;&#x5217;&#x5316;&#x7684;&#x5BF9;&#x8C61;&#xFF0C;&#x7531;&#x4E8E;&#x662F;&#x5B57;&#x8282;&#x6D41;&#x7684;&#x5F62;&#x5F0F;&#xFF0C;&#x5176;&#x5360;&#x7528;&#x7684;&#x5185;&#x5B58;&#x5927;&#x5C0F;&#x53EF;&#x76F4;&#x63A5;&#x8BA1;&#x7B97;&#xFF0C;&#x800C;&#x5BF9;&#x4E8E;&#x975E;&#x5E8F;&#x5217;&#x5316;&#x7684;&#x5BF9;&#x8C61;&#xFF0C;&#x5176;&#x5360;&#x7528;&#x7684;&#x5185;&#x5B58;&#x662F;&#x901A;&#x8FC7;&#x5468;&#x671F;&#x6027;&#x5730;&#x91C7;&#x6837;&#x8FD1;&#x4F3C;&#x4F30;&#x7B97;&#x800C;&#x5F97;&#xFF0C;&#x5373;&#x5E76;&#x4E0D;&#x662F;&#x6BCF;&#x6B21;&#x65B0;&#x589E;&#x7684;&#x6570;&#x636E;&#x9879;&#x90FD;&#x4F1A;&#x8BA1;&#x7B97;&#x4E00;&#x6B21;&#x5360;&#x7528;&#x7684;&#x5185;&#x5B58;&#x5927;&#x5C0F;&#xFF0C;&#x8FD9;&#x79CD;&#x65B9;&#x6CD5;&#x964D;&#x4F4E;&#x4E86;&#x65F6;&#x95F4;&#x5F00;&#x9500;&#x4F46;&#x662F;&#x6709;&#x53EF;&#x80FD;&#x8BEF;&#x5DEE;&#x8F83;&#x5927;&#xFF0C;&#x5BFC;&#x81F4;&#x67D0;&#x4E00;&#x65F6;&#x523B;&#x7684;&#x5B9E;&#x9645;&#x5185;&#x5B58;&#x6709;&#x53EF;&#x80FD;&#x8FDC;&#x8FDC;&#x8D85;&#x51FA;&#x9884;&#x671F;&#x3002;</p>
</li>
<li><p>&#x6B64;&#x5916;&#xFF0C;&#x5728;&#x88AB; Spark &#x6807;&#x8BB0;&#x4E3A;&#x91CA;&#x653E;&#x7684;&#x5BF9;&#x8C61;&#x5B9E;&#x4F8B;&#xFF0C;&#x5F88;&#x6709;&#x53EF;&#x80FD;&#x5728;&#x5B9E;&#x9645;&#x4E0A;&#x5E76;&#x6CA1;&#x6709;&#x88AB; JVM &#x56DE;&#x6536;&#xFF0C;&#x5BFC;&#x81F4;&#x5B9E;&#x9645;&#x53EF;&#x7528;&#x7684;&#x5185;&#x5B58;&#x5C0F;&#x4E8E; Spark &#x8BB0;&#x5F55;&#x7684;&#x53EF;&#x7528;&#x5185;&#x5B58;&#x3002;&#x6240;&#x4EE5; Spark &#x5E76;&#x4E0D;&#x80FD;&#x51C6;&#x786E;&#x8BB0;&#x5F55;&#x5B9E;&#x9645;&#x53EF;&#x7528;&#x7684;&#x5806;&#x5185;&#x5185;&#x5B58;&#xFF0C;&#x4ECE;&#x800C;&#x4E5F;&#x5C31;&#x65E0;&#x6CD5;&#x5B8C;&#x5168;&#x907F;&#x514D;&#x5185;&#x5B58;&#x6EA2;&#x51FA;&#xFF08;OOM, Out of Memory&#xFF09;&#x7684;&#x5F02;&#x5E38;&#x3002;</p>
</li>
<li><p>&#x867D;&#x7136;&#x4E0D;&#x80FD;&#x7CBE;&#x51C6;&#x63A7;&#x5236;&#x5806;&#x5185;&#x5185;&#x5B58;&#x7684;&#x7533;&#x8BF7;&#x548C;&#x91CA;&#x653E;&#xFF0C;&#x4F46; Spark &#x901A;&#x8FC7;&#x5BF9;&#x5B58;&#x50A8;&#x5185;&#x5B58;&#x548C;&#x6267;&#x884C;&#x5185;&#x5B58;&#x5404;&#x81EA;&#x72EC;&#x7ACB;&#x7684;&#x89C4;&#x5212;&#x7BA1;&#x7406;&#xFF0C;&#x53EF;&#x4EE5;&#x51B3;&#x5B9A;&#x662F;&#x5426;&#x8981;&#x5728;&#x5B58;&#x50A8;&#x5185;&#x5B58;&#x91CC;&#x7F13;&#x5B58;&#x65B0;&#x7684; RDD&#xFF0C;&#x4EE5;&#x53CA;&#x662F;&#x5426;&#x4E3A;&#x65B0;&#x7684;&#x4EFB;&#x52A1;&#x5206;&#x914D;&#x6267;&#x884C;&#x5185;&#x5B58;&#xFF0C;&#x5728;&#x4E00;&#x5B9A;&#x7A0B;&#x5EA6;&#x4E0A;&#x53EF;&#x4EE5;&#x63D0;&#x5347;&#x5185;&#x5B58;&#x7684;&#x5229;&#x7528;&#x7387;&#xFF0C;&#x51CF;&#x5C11;&#x5F02;&#x5E38;&#x7684;&#x51FA;&#x73B0;&#x3002;</p>
</li>
</ol>
<h2 id="&#x5806;&#x5916;&#x5185;&#x5B58;">&#x5806;&#x5916;&#x5185;&#x5B58;</h2>
<p>&#x4E3A;&#x4E86;&#x8FDB;&#x4E00;&#x6B65;&#x4F18;&#x5316;&#x5185;&#x5B58;&#x7684;&#x4F7F;&#x7528;&#x4EE5;&#x53CA;&#x63D0;&#x9AD8; Shuffle &#x65F6;&#x6392;&#x5E8F;&#x7684;&#x6548;&#x7387;&#xFF0C;Spark &#x5F15;&#x5165;&#x4E86;&#x5806;&#x5916;&#xFF08;Off-heap&#xFF09;&#x5185;&#x5B58;&#xFF0C;&#x4F7F;&#x4E4B;&#x53EF;&#x4EE5;<my>&#x76F4;&#x63A5;&#x5728;&#x5DE5;&#x4F5C;&#x8282;&#x70B9;&#x7684;&#x7CFB;&#x7EDF;&#x5185;&#x5B58;&#x4E2D;&#x5F00;&#x8F9F;&#x7A7A;&#x95F4;&#xFF0C;&#x5B58;&#x50A8;&#x7ECF;&#x8FC7;&#x5E8F;&#x5217;&#x5316;&#x7684;&#x4E8C;&#x8FDB;&#x5236;&#x6570;&#x636E;&#x3002;</my></p>
<p>&#x5806;&#x5916;&#x5185;&#x5B58;&#x610F;&#x5473;&#x7740;&#x628A;&#x5185;&#x5B58;&#x5BF9;&#x8C61;&#x5206;&#x914D;&#x5728; Java &#x865A;&#x62DF;&#x673A;&#x7684;&#x5806;&#x4EE5;&#x5916;&#x7684;&#x5185;&#x5B58;&#xFF0C;&#x8FD9;&#x4E9B;&#x5185;&#x5B58;<my>&#x76F4;&#x63A5;&#x53D7;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x7BA1;&#x7406;&#xFF08;&#x800C;&#x4E0D;&#x662F;&#x865A;&#x62DF;&#x673A;&#xFF09;</my>&#x3002;&#x8FD9;&#x6837;&#x505A;&#x7684;&#x7ED3;&#x679C;&#x5C31;&#x662F;&#x80FD;&#x4FDD;&#x6301;&#x4E00;&#x4E2A;&#x8F83;&#x5C0F;&#x7684;&#x5806;&#xFF0C;&#x4EE5;&#x51CF;&#x5C11;&#x5783;&#x573E;&#x6536;&#x96C6;&#x5BF9;&#x5E94;&#x7528;&#x7684;&#x5F71;&#x54CD;&#x3002;</p>
<p>&#x5229;&#x7528; JDK Unsafe API&#xFF0C;Spark &#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x5806;&#x5916;&#x5185;&#x5B58;&#xFF0C;&#x51CF;&#x5C11;&#x4E86;&#x4E0D;&#x5FC5;&#x8981;&#x7684;&#x5185;&#x5B58;&#x5F00;&#x9500;&#xFF0C;&#x4EE5;&#x53CA;&#x9891;&#x7E41;&#x7684; GC &#x626B;&#x63CF;&#x548C;&#x56DE;&#x6536;&#xFF0C;&#x63D0;&#x5347;&#x4E86;&#x5904;&#x7406;&#x6027;&#x80FD;&#x3002;</p>
<p>&#x5806;&#x5916;&#x5185;&#x5B58;&#x53EF;&#x4EE5;&#x88AB;&#x7CBE;&#x786E;&#x5730;&#x7533;&#x8BF7;&#x548C;&#x91CA;&#x653E;&#xFF08;&#x5806;&#x5916;&#x5185;&#x5B58;&#x4E4B;&#x6240;&#x4EE5;&#x80FD;&#x591F;&#x88AB;&#x7CBE;&#x786E;&#x7684;&#x7533;&#x8BF7;&#x548C;&#x91CA;&#x653E;&#xFF0C;&#x662F;&#x7531;&#x4E8E;&#x5185;&#x5B58;&#x7684;&#x7533;&#x8BF7;&#x548C;&#x91CA;&#x653E;&#x4E0D;&#x518D;&#x901A;&#x8FC7;JVM&#x673A;&#x5236;&#xFF0C;&#x800C;&#x662F;&#x76F4;&#x63A5;&#x5411;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x7533;&#x8BF7;&#xFF0C;JVM&#x5BF9;&#x4E8E;&#x5185;&#x5B58;&#x7684;&#x6E05;&#x7406;&#x662F;&#x65E0;&#x6CD5;&#x51C6;&#x786E;&#x6307;&#x5B9A;&#x65F6;&#x95F4;&#x70B9;&#x7684;&#xFF0C;&#x56E0;&#x6B64;&#x65E0;&#x6CD5;&#x5B9E;&#x73B0;&#x7CBE;&#x786E;&#x7684;&#x91CA;&#x653E;&#xFF09;&#xFF0C;&#x800C;&#x4E14;&#x5E8F;&#x5217;&#x5316;&#x7684;&#x6570;&#x636E;&#x5360;&#x7528;&#x7684;&#x7A7A;&#x95F4;&#x53EF;&#x4EE5;&#x88AB;&#x7CBE;&#x786E;&#x8BA1;&#x7B97;&#xFF0C;&#x6240;&#x4EE5;&#x76F8;&#x6BD4;&#x5806;&#x5185;&#x5185;&#x5B58;&#x6765;&#x8BF4;&#x964D;&#x4F4E;&#x4E86;&#x7BA1;&#x7406;&#x7684;&#x96BE;&#x5EA6;&#xFF0C;&#x4E5F;&#x964D;&#x4F4E;&#x4E86;&#x8BEF;&#x5DEE;&#x3002;</p>
<p>&#x5728;&#x9ED8;&#x8BA4;&#x60C5;&#x51B5;&#x4E0B;&#x5806;&#x5916;&#x5185;&#x5B58;&#x5E76;&#x4E0D;&#x542F;&#x7528;&#xFF0C;&#x53EF;&#x901A;&#x8FC7;&#x914D;&#x7F6E; <code>spark.memory.offHeap.enabled</code> &#x53C2;&#x6570;&#x542F;&#x7528;&#xFF0C;&#x5E76;&#x7531; <code>spark.memory.offHeap.size</code> &#x53C2;&#x6570;&#x8BBE;&#x5B9A;&#x5806;&#x5916;&#x7A7A;&#x95F4;&#x7684;&#x5927;&#x5C0F;&#x3002;</p>
<p>&#x9664;&#x4E86;&#x6CA1;&#x6709; <code>other</code> &#x7A7A;&#x95F4;&#xFF0C;&#x5806;&#x5916;&#x5185;&#x5B58;&#x4E0E;&#x5806;&#x5185;&#x5185;&#x5B58;&#x7684;&#x5212;&#x5206;&#x65B9;&#x5F0F;&#x76F8;&#x540C;&#xFF0C;<my>&#x6240;&#x6709;&#x8FD0;&#x884C;&#x4E2D;&#x7684;&#x5E76;&#x53D1;&#x4EFB;&#x52A1;&#x5171;&#x4EAB;&#x5B58;&#x50A8;&#x5185;&#x5B58;&#x548C;&#x6267;&#x884C;&#x5185;&#x5B58;&#x3002;</my></p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; &#x5C1A;&#x7845;&#x8C37;&#x5927;&#x6570;&#x636E; 2019 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification"><br>&#x8BE5;&#x6587;&#x4EF6;&#x6700;&#x540E;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2019-06-11 14:56:44
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="di-6-zhang-spark-nei-cun-jie-xi.html" class="navigation navigation-prev " aria-label="Previous page: 第 6 章 Spark 内存管理">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="62-nei-cun-kong-jian-fen-pei.html" class="navigation navigation-next " aria-label="Next page: 6.2 内存空间分配">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"6.1 堆内核堆外内存规划","level":"1.6.1","depth":2,"next":{"title":"6.2 内存空间分配","level":"1.6.2","depth":2,"path":"62-nei-cun-kong-jian-fen-pei.md","ref":"62-nei-cun-kong-jian-fen-pei.md","articles":[]},"previous":{"title":"第 6 章 Spark 内存管理","level":"1.6","depth":1,"path":"di-6-zhang-spark-nei-cun-jie-xi.md","ref":"di-6-zhang-spark-nei-cun-jie-xi.md","articles":[{"title":"6.1 堆内核堆外内存规划","level":"1.6.1","depth":2,"path":"61-dui-nei-he-dui-wai-nei-cun-gui-hua.md","ref":"61-dui-nei-he-dui-wai-nei-cun-gui-hua.md","articles":[]},{"title":"6.2 内存空间分配","level":"1.6.2","depth":2,"path":"62-nei-cun-kong-jian-fen-pei.md","ref":"62-nei-cun-kong-jian-fen-pei.md","articles":[]},{"title":"6.3 存储内存管理","level":"1.6.3","depth":2,"path":"63-cun-chu-nei-cun-guan-li.md","ref":"63-cun-chu-nei-cun-guan-li.md","articles":[]},{"title":"6.4 执行内存管理","level":"1.6.4","depth":2,"path":"64-zhi-xing-nei-cun-guan-li.md","ref":"64-zhi-xing-nei-cun-guan-li.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["splitter","expandable-chapters-small","page-toc-button","-highlight","prism","prism-themes","tbfed-pagefooter","sitemap","change_girls","livereload"],"styles":{"website":"styles/website.css","ebook":"styles/ebook.css","pdf":"styles/pdf.css","mobi":"styles/mobi.css","epub":"styles/epub.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy 尚硅谷大数据 2019","modify_label":"<br>该文件最后修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{"css":["prismjs/themes/prism-solarizedlight.css"]},"disqus":{"shortName":"zhenchao125"},"livereload":{},"splitter":{},"change_girls":{"time":30,"urls":["http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/62171757.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/83394736.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/15906185.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/15906185.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/3394270.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/65028582.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/20359261.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/37472401.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/3355397.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/11075549.jpg-atguiguImg"]},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"sitemap":{"hostname":"http://bigdataatguigu.applinzi.com/"},"page-toc-button":{"maxTocDepth":3,"minTocSize":2},"prism-themes":{},"expandable-chapters-small":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":" 李振超","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"大数据 bigdata_spark_kernel-optimize_atguigu 课堂笔记","language":"zh-hans","links":{"sidebar":{"联系我们":"http://www.atguigu.com/"}},"gitbook":"*","description":"课堂笔记,学生提前预习"},"file":{"path":"61-dui-nei-he-dui-wai-nei-cun-gui-hua.md","mtime":"2019-06-11T06:56:44.532Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-07-15T00:07:35.887Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-page-toc-button/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-change_girls/girls.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

